package com.wthink.hzgj.copyFile.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import com.wthink.hzgj.BR
import com.wthink.hzgj.R
import com.wthink.hzgj.data.domain.FileDetail
import com.wthink.hzgj.util.Log
import com.wthink.hzgj.util.adapter.AutoUpdatableAdapter
import com.wthink.hzgj.util.adapter.BaseViewHolder

open class CameraListCheckAdapter : AutoUpdatableAdapter<BaseViewHolder, FileDetail>({ o: FileDetail, n: FileDetail ->
    o.equals(n)
}) {

    override fun update(items: List<Any>) {
        super.update(items)
        Log.debug("update at: ${System.currentTimeMillis()},size: ${items.size}")
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
        val dataBinding = DataBindingUtil.inflate<ViewDataBinding>(
            LayoutInflater.from(parent.context),
            R.layout.item_camera_file_check,
            parent,
            false
        )

        return BaseViewHolder(dataBinding, BR.viewModel)
    }

}